//package com.lt.test.consumer.controller;
//
//import com.alibaba.dubbo.config.annotation.Reference;
//import com.lt.test.api.AttendnService;
//import com.lt.test.api.KtCommonService;
//import com.lt.test.common.util.WebUtils;
//import com.lt.test.entity.DTO.ActiveUser;
//import com.lt.test.entity.DTO.ResponseDTO;
//import org.apache.shiro.SecurityUtils;
//import org.apache.shiro.subject.Subject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.UnsupportedEncodingException;
//import java.util.List;
//import java.util.Map;
//
//@Controller
//@RequestMapping("/attendn")
//public class AttendnController {
//	private static final Logger logger = LoggerFactory.getLogger(AttendnController.class);
//
//	@Reference(version = "1.0.0")
//	private AttendnService attendnService;
//
//	@Reference(version = "1.0.0")
//	private KtCommonService ktCommonService;
//
//	@RequestMapping("/scheduling")
//	public ModelAndView scheduling(HttpServletRequest request){
//		ModelAndView mav = new ModelAndView();
//		mav.setViewName("content/attendn/scheduling");
//		return mav;
//	}
//    @RequestMapping(value = "getShops",method= RequestMethod.POST)
//    public @ResponseBody
//    ResponseDTO getShops(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException{
//    	response.setContentType("text/html;charset=UTF-8");
//    	Map<String,String> parameter = WebUtils.getAllParamMap(request);
//    	Subject subject = SecurityUtils.getSubject();
//        ActiveUser activeUser = (ActiveUser) subject.getPrincipal();
//        parameter.put("roleNo", activeUser.getRoleNo());
//        parameter.put("userId", activeUser.getClouderUser());
//    	List<Map<String, Object>> shopName = ktCommonService.getShopList2User(parameter);
//    	ResponseDTO responseDTO = new ResponseDTO();
//        responseDTO.setSuccess(true);
//        responseDTO.setData(shopName);
//    	return responseDTO;
//    }
//	@RequestMapping("/getshopSigninAndDutyUser")
//	public @ResponseBody
//    ResponseDTO getshopSigninAndDutyUser(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//
//		Map<String, List<Map<String, Object>>> result = null;
//		ResponseDTO responseDTO = new ResponseDTO();
//        try{
//        	result = attendnService.getshopSigninAndDutyUser(params);
//        	responseDTO.setSuccess(true);
//            responseDTO.setCode("200");
//            responseDTO.setMessage("加载成功");
//        }catch(Exception e){
//        	logger.error("加载信息失败");
//            e.printStackTrace();
//        }
//        responseDTO.setData(result);
//        return responseDTO;
//	}
//
//	@RequestMapping("/getshopstaffAndDutyUser")
//	public @ResponseBody
//    ResponseDTO getshopstaffAndDutyUser(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//
//		Map<String, List<Map<String, Object>>> result = null;
//		ResponseDTO responseDTO = new ResponseDTO();
//        try{
//        	result = attendnService.getshopstaffAndDutyUser(params);
//        	responseDTO.setSuccess(true);
//            responseDTO.setCode("200");
//            responseDTO.setMessage("加载成功");
//        }catch(Exception e){
//        	logger.error("加载信息失败");
//            e.printStackTrace();
//        }
//        responseDTO.setData(result);
//        return responseDTO;
//	}
//	@RequestMapping("/getShopUsersDutyList")
//	public @ResponseBody
//    ResponseDTO getShopUsersDutyList(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//	    List<Map<String, Object>> result = null;
//	    ResponseDTO responseDTO = new ResponseDTO();
//        try{
//	        result = attendnService.getShopUsersDutyList(params);
//	        responseDTO.setSuccess(true);
//	        responseDTO.setCode("200");
//	        responseDTO.setMessage("加载成功");
//        }catch(Exception e){
//      		logger.error("获取商品信息失败");
//      		e.printStackTrace();
//        }
//      	responseDTO.setData(result);
//      	return responseDTO;
//	}
//	@RequestMapping("/getShopUserDutyList")
//	public @ResponseBody
//    ResponseDTO getShopUserDutyList(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//
//	    List<Map<String, Object>> result = null;
//	    ResponseDTO responseDTO = new ResponseDTO();
//        try{
//	        result = attendnService.getShopUserDutyList(params);
//	        responseDTO.setSuccess(true);
//	        responseDTO.setCode("200");
//	        responseDTO.setMessage("加载成功");
//        }catch(Exception e){
//      		logger.error("获取商品信息失败");
//      		e.printStackTrace();
//        }
//      	responseDTO.setData(result);
//        return responseDTO;
//	}
//	@RequestMapping("/insertShopUserDuty")
//	public @ResponseBody
//    ResponseDTO insertShopUserDuty(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//		Subject subject = SecurityUtils.getSubject();
//        ActiveUser activeUser = (ActiveUser) subject.getPrincipal();
//        params.put("createUser", activeUser.getUsername());
//        params.put("modifyUser", activeUser.getUsername());
//		ResponseDTO responseDTO = null;
//		try{
//			responseDTO = attendnService.insertShopUserDuty(params);
//		}catch(Exception e){
//			logger.error("操作失败");
//			e.printStackTrace();
//		}
//        return responseDTO;
//	}
//	@RequestMapping("/updateShopUserDuty")
//	public @ResponseBody
//    ResponseDTO updateShopUserDuty(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//		Subject subject = SecurityUtils.getSubject();
//        ActiveUser activeUser = (ActiveUser) subject.getPrincipal();
//        params.put("modifyUser", activeUser.getUsername());
//		ResponseDTO responseDTO = null;
//		try{
//			responseDTO = attendnService.updateShopUserDuty(params);
//		}catch(Exception e){
//			logger.error("操作失败");
//			e.printStackTrace();
//		}
//        return responseDTO;
//	}
//	@RequestMapping("/deleteShopUserDutyById")
//	public @ResponseBody
//    ResponseDTO deleteShopUserDutyById(HttpServletRequest request) throws UnsupportedEncodingException{
//		request.setCharacterEncoding("utf-8");
//		Map<String, String> params = WebUtils.getAllParamMap(request);
//
//		ResponseDTO responseDTO = null;
//	    try{
//	    	responseDTO = attendnService.deleteShopUserDutyById(params.get("id"));
//	    }catch(Exception e){
//	    	logger.error("操作失败");
//	        e.printStackTrace();
//	    }
//        return responseDTO;
//	}
//
//
//}
